package base.standard.constant;

/**
 * Thread local params
 *
 * @description: 上线文工具
 * @author: cyj
 * @date 2020 -10-21 20:34:11
 */
public class ThreadLocalParams {

    /**
     * LOGIN_ID
     */
    private static final ThreadLocal<String> LOGIN_ID = new ThreadLocal<>();

    /**
     * USER_ID
     */
    private static final ThreadLocal<String> USER_ID = new ThreadLocal<>();

    /**
     * AUTH_MESSAGE
     */
    private static final ThreadLocal<String> AUTH_MESSAGE = new ThreadLocal<>();

    /**
     * Gets auth message * @description:
     *
     * @return the auth message
     */
    public static String getAuthMessage() {
        return AUTH_MESSAGE.get();
    }

    /**
     * Sets auth message * @description:
     *
     * @param messageStr message str
     */
    public static void setAuthMessage(String messageStr) {
        AUTH_MESSAGE.set(messageStr);
    }

    /**
     * Remove auth message
     */
    public static void removeAuthMessage() {
        AUTH_MESSAGE.remove();
    }

    /**
     * Gets login id * @description: user表loginId
     *
     * @return the login id
     */
    public static String getLoginId() {
        return LOGIN_ID.get();
    }

    /**
     * Sets login id * @description:
     *
     * @param loginIdStr login id str
     */
    public static void setLoginId(String loginIdStr) {
        LOGIN_ID.set(loginIdStr);
    }

    /**
     * Remove login id
     */
    public static void removeLoginId() {
        LOGIN_ID.remove();
    }

    /**
     * Gets user id * @description: user表id
     *
     * @return the user id
     */
    public static String getUserId() {
        return USER_ID.get();
    }

    /**
     * Sets user id * @description:
     *
     * @param userIdStr user id str
     */
    public static void setUserId(String userIdStr) {
        USER_ID.set(userIdStr);
    }

    /**
     * Remove user id
     */
    public static void removeUserId() {
        USER_ID.remove();
    }
}
